VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.MDIForm menu 
   BackColor       =   &H80000009&
   Caption         =   "CENTRO DE AGUAS Y SANEAMINETO AMBIENTAL"
   ClientHeight    =   8190
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   11400
   LinkTopic       =   "MDIForm1"
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin MSComctlLib.Toolbar menu_toolbar 
      Align           =   1  'Align Top
      Height          =   360
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   11400
      _ExtentX        =   20108
      _ExtentY        =   635
      ButtonWidth     =   609
      ButtonHeight    =   582
      Appearance      =   1
      Style           =   1
      ImageList       =   "imlToolbarIcons"
      HotImageList    =   "imlToolbarIcons"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   12
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "ac"
            Object.ToolTipText     =   "Aguas de Consumo"
            ImageKey        =   "ac"
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "r1"
            Object.ToolTipText     =   "Residuos Industriales Liq."
            ImageKey        =   "r1"
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "r2"
            Object.ToolTipText     =   "Residuos Domesticos Liq."
            ImageKey        =   "r2"
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "sep"
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "fisi"
            ImageKey        =   "fisi"
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "sep1"
            Style           =   3
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "guardar"
            Object.ToolTipText     =   "Guardar"
            ImageKey        =   "guardar"
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "imprimir"
            Object.ToolTipText     =   "Imprimir"
            ImageKey        =   "imprimir"
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Enabled         =   0   'False
            Object.Visible         =   0   'False
            Key             =   "ayuda"
            Object.ToolTipText     =   "Ayuda"
            ImageKey        =   "ayuda"
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "salir"
            Object.ToolTipText     =   "Salir"
            ImageKey        =   "salir"
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "nuevo"
            Object.ToolTipText     =   "Informe"
            ImageKey        =   "nuevo"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList imlToolbarIcons 
      Left            =   0
      Top             =   0
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   11
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":0000
            Key             =   "nuevo"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":1D0C
            Key             =   "ac"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":6C7C
            Key             =   "abrir"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":CF18
            Key             =   "guardar"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":D7F4
            Key             =   "imprimir"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":13418
            Key             =   "salir"
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":1386C
            Key             =   "ayuda"
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":13E08
            Key             =   "r1"
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":18FB4
            Key             =   "r2"
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":1EDC4
            Key             =   "fisi"
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "menu.frx":249D8
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComDlg.CommonDialog cdialog 
      Left            =   120
      Top             =   720
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin MSComctlLib.StatusBar barraBaja 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   1
      Top             =   7815
      Width           =   11400
      _ExtentX        =   20108
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   4
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Text            =   "Estado"
            TextSave        =   "Estado"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   11880
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   6
            TextSave        =   "18/07/2012"
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            TextSave        =   "10:33"
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Menu form_princi 
      Caption         =   "Formularios"
      Begin VB.Menu subnuevoac 
         Caption         =   "&Aguas de Consumo"
      End
      Begin VB.Menu subnuevoAn 
         Caption         =   "&Agua Natural"
      End
      Begin VB.Menu subnuevoril 
         Caption         =   "&Residuos Industriales Liq."
      End
      Begin VB.Menu subnuevordl 
         Caption         =   "Residuos &Domesticos Liq."
      End
      Begin VB.Menu raya1 
         Caption         =   "-"
      End
      Begin VB.Menu subsalir 
         Caption         =   "Salir"
      End
   End
   Begin VB.Menu modificar 
      Caption         =   "Modificar"
      Enabled         =   0   'False
   End
   Begin VB.Menu menuanalisis 
      Caption         =   "Analisis"
      Begin VB.Menu subfisico 
         Caption         =   "Fisicoquimico"
         Begin VB.Menu subFnuevo 
            Caption         =   "Nuevo"
         End
         Begin VB.Menu subFM 
            Caption         =   "Modificar"
         End
      End
      Begin VB.Menu submicro 
         Caption         =   "Microbiologico"
         Begin VB.Menu subNM 
            Caption         =   "Nuevo"
         End
         Begin VB.Menu subMM 
            Caption         =   "Modificar"
         End
      End
   End
   Begin VB.Menu submenurep 
      Caption         =   "Reportes"
      Begin VB.Menu subllenar 
         Caption         =   "Basico"
         Begin VB.Menu subllfisi 
            Caption         =   "Fisicoquimico"
            Begin VB.Menu subRNFisi 
               Caption         =   "Nuevo"
            End
            Begin VB.Menu subRMfi 
               Caption         =   "Modificar"
            End
         End
         Begin VB.Menu sublleMi 
            Caption         =   "Microbiologico"
            Begin VB.Menu subBnuevo 
               Caption         =   "Nuevo"
            End
            Begin VB.Menu subBMo 
               Caption         =   "Modificar"
            End
         End
      End
      Begin VB.Menu subResidual 
         Caption         =   "Residual"
         Begin VB.Menu subResFisi 
            Caption         =   "Fisiquimico"
            Begin VB.Menu subResNueFi 
               Caption         =   "Nuevo"
            End
            Begin VB.Menu subResMo 
               Caption         =   "Modificar"
            End
         End
         Begin VB.Menu subResMicro 
            Caption         =   "Microbiologico"
            Begin VB.Menu subResNmicro 
               Caption         =   "Nuevo"
            End
            Begin VB.Menu subResMoMicro 
               Caption         =   "Modificar"
            End
         End
      End
      Begin VB.Menu subRiego 
         Caption         =   "Riego"
         Begin VB.Menu subrieNue 
            Caption         =   "Nuevo"
         End
         Begin VB.Menu subRieModi 
            Caption         =   "Modificar"
         End
      End
      Begin VB.Menu subHormigon 
         Caption         =   "Hormigon"
         Begin VB.Menu subHnue 
            Caption         =   "Nuevo"
         End
         Begin VB.Menu subHmodi 
            Caption         =   "Modificar"
         End
      End
   End
   Begin VB.Menu menudiagramas 
      Caption         =   "Diagramas"
      Enabled         =   0   'False
      Begin VB.Menu subTickel 
         Caption         =   "Tickel"
      End
   End
   Begin VB.Menu menuestadisticos 
      Caption         =   "Cuadros Estadisticos"
      Enabled         =   0   'False
   End
   Begin VB.Menu admin 
      Caption         =   "Administrador"
      Enabled         =   0   'False
      Begin VB.Menu sublista 
         Caption         =   "Lista parametros"
      End
      Begin VB.Menu raya3 
         Caption         =   "-"
      End
      Begin VB.Menu subInsertar 
         Caption         =   "Insertar"
         Begin VB.Menu subusuario 
            Caption         =   "Usuario"
         End
         Begin VB.Menu subPI 
            Caption         =   "Parametro"
         End
         Begin VB.Menu subTCI 
            Caption         =   "Tipo de Cambio"
         End
      End
      Begin VB.Menu subM 
         Caption         =   "Modificar"
      End
      Begin VB.Menu subElim 
         Caption         =   "Eliminar"
      End
   End
   Begin VB.Menu menuayuda 
      Caption         =   "Ayuda"
      Enabled         =   0   'False
   End
End
Attribute VB_Name = "menu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'*****************************************************
' Finalidad: Menu de la barra principal
'*****************************************************
Private Sub subnuevoac_Click()
bandProtocolo = 0: ac.Show
End Sub
Private Sub subnuevoAn_Click()
an.Show
End Sub
Private Sub subnuevoril_Click()
ril.Show
End Sub
Private Sub subnuevordl_Click()
rdl.Show
End Sub

Private Sub subsalir_Click()
End
End Sub
Private Sub modificar_Click()
modificar_form.Show
End Sub
Private Sub subFnuevo_Click()
bandEnsayo = 1: fisicoquimico.Show 'Nuevo
End Sub
Private Sub subFM_Click()
bandEnsayo = 2: fisicoquimico.Show 'Modificar
End Sub
Private Sub subNM_Click()
bandEnsayo = 1: microbiologico.Show 'nuevo
End Sub
Private Sub subMM_Click()
bandEnsayo = 2: microbiologico.Show 'Modificar
End Sub
'*****************************************************
' Finalidad: Menu de la barra principal Reportes
'*****************************************************
'Private Sub subllfisi_Click()
'bandReporte = 1: rep_fisico.Show 'reportes fisicoquimico
'End Sub
Private Sub subRNFisi_Click()
bandModi = 0: bandReporte = 1: rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub
Private Sub subBnuevo_Click()
bandModi = 0: bandReporte = 1: rep_micro.Show
If bandReporte = 0 Then Unload rep_micro
End Sub
Private Sub subRMfi_Click()
bandModi = 1: bandReporte = 1: rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub
Private Sub subBMo_Click()
bandModi = 1: bandReporte = 1: rep_micro.Show
If bandReporte = 0 Then Unload rep_micro
End Sub
'residual
Private Sub subResNueFi_Click()
bandModi = 0: bandReporte = 2: rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub
Private Sub subResMo_Click()
bandModi = 1: bandReporte = 2: rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub
Private Sub subResNmicro_Click()
bandModi = 0: bandReporte = 2: rep_micro.Show
If bandReporte = 0 Then Unload rep_micro
End Sub
Private Sub subResMoMicro_Click()
bandModi = 1: bandReporte = 2: rep_micro.Show
If bandReporte = 0 Then Unload rep_micro
End Sub
Private Sub subrieNue_Click()
bandModi = 0: bandReporte = 3:
rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub
Private Sub subRieModi_Click()
bandModi = 1: bandReporte = 3: rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub
Private Sub subHnue_Click()
bandModi = 0: bandReporte = 4: rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub
Private Sub subHmodi_Click()
bandModi = 1: bandReporte = 4: rep_fisico.Show
If bandReporte = 0 Then Unload rep_fisico
End Sub

'*****************************************************
' Finalidad: GRAFICOS de la barra principal
'*****************************************************
Private Sub subTickel_Click()
buscar.Show
End Sub
'*****************************************************
' Finalidad: ESTADISTICAS de la barra principal
'*****************************************************
Private Sub menuestadisticos_Click()
 estadistica.Show
End Sub
'*****************************************************
' Finalidad: ADMINISTRADOR de la barra principal
'*****************************************************
Private Sub sublista_Click() 'lista de los parametros existentes
listParam.Show
End Sub
Private Sub subusuario_Click() 'INSERTAR USUARIO
 usuarios.Show
End Sub
Private Sub subPI_Click() 'INSERTAR PARAMETROS
'costosParam.txt_cambio.Text = tipoCambio()
costosParam.Show
End Sub
Private Sub subTCI_Click() 'TIPO DE CAMBIO
tipo_Cambio.Show
End Sub
Private Sub subM_Click() 'MODIFICAR COSTO
modi_costo.Show
End Sub
Private Sub subElim_Click() 'ELIMINAR
  'Call datosReporte
  'DataReport2.Show
End Sub
'*****************************************************
' Finalidad: AYUDA de la barra principal
'*****************************************************
'*****************************************************
' Finalidad: BARRA DE HERRAMIENTAS
'*****************************************************
Private Sub menu_toolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
 Select Case Button.Key
 Case "ac"
  ac.Show
 Case "r1"
  ril.Show
 Case "r2"
  rdl.Show
 Case "guardar"
  Call guardar_tool_click
 Case "imprimir"
 Case "fisi" 'NUEVO ENSAYO FISICOQUIMICO
  bandEnsayo = 1: Call subFnuevo_Click
 Case "salir"
 
  End
 Case "nuevo"
 End Select
End Sub
'*****************************************************
' Finalidad: FUNCION GUARDAR LOS FORMULARIOS
'*****************************************************
Private Sub guardar_tool_click()
Dim cont As Long, r As Long, i As Long
Dim cad As String, mensaje As String
Dim aux As String, aux3 As String, bandProtocolo As Integer
'## BUSCAR FORM
 For Each colecForms In Forms
 If colecForms.Name = nombreform Then 'Si es el mismo nombre del form
    Set nombForm = colecForms 'Asignarlo a la variable
 End If
Next
'INSERTAR Y MODIFICAR PROTOCOLOS
bandProtocolo = 0
Select Case nombreform
Case Is = "ac", Is = "an", Is = "rdl", Is = "ril"
 Select Case bandProtocolo
 Case Is = 0 'Nuevo
  If pregObligatorias(nombreform) = 1 Then
  'Call insertProtocolo(nombreform)
   aux = insertProtocolo(nombreform)
   If aux = 1 Then
   aux3 = mensajes(5) 'se ingreso satisfactoriamente
   Unload Me 'cierro
   nombForm.Show 'abro
   End If
  End If
 Case Is = 1 'modificar
 End Select
'*** ENSAYO
Case Is = "fisicoquimico"

  r = nombForm.flex_analisis.Rows
  For i = 0 To r - 1
  aux3 = nombForm.flex_analisis.TextMatrix(i, 0)
  If aux3 = "OTROS" Then cad = nombForm.flex_analisis.TextMatrix(i, 2)
  Next i
  aux = UpdateEnsayo(1, cad, nombForm.cmb_reg.Text, nombForm.cmb_muestra.Text, r - 1)
  If aux = 1 Then
   aux3 = mensajes(5) 'se ingreso satisfactoriamente
   Unload Me 'cierro
   nombForm.Show 'abro
  Else
  cad = mensajes(6) 'se ingreso incorrectamente
  End If
Case Is = "microbiologico"

 r = nombForm.flex_analisis.Rows
 aux = devolverCod("cod_protocolo as cod", "protocolo", "nro_reg='" & nombForm.cmb_reg.Text & "'", 0)
 If nombForm.cmb_pat <> "Ape. Paterno" And nombForm.cmb_mat <> "Ape. Materno" And nombForm.cmb_nomb <> "Nombre(s)" Then
 aux3 = codPersonal(nombForm.cmb_pat & "-" & nombForm.cmb_mat & "-" & nombForm.cmb_nomb, "")
 Else
 aux3 = 0
 End If
 'modifica la fecha
 cad = UpdateFech(aux, nombForm.dtp_fanalisis.Year & "-" & nombForm.dtp_fanalisis.Month & "-" & nombForm.dtp_fanalisis.Day, colocarNum(nombForm.dtp_Hensayo.Hour) & ":" & colocarNum(nombForm.dtp_Hensayo.Minute), aux3)
 'modificar parametros
 aux = cad: cad = ""
 For i = 1 To r - 1
 aux3 = nombForm.flex_analisis.TextMatrix(i, 0)
 If aux3 = "CONCLUSIONES" Then cad = nombForm.flex_analisis.TextMatrix(i, 3)
 Next i
 If aux = 1 Then
  aux3 = UpdateEnsayo(2, cad, nombForm.cmb_reg.Text, nombForm.cmb_muestra.Text, r - 1)
  If aux3 = 1 Then
   cad = mensajes(5) 'se ingreso satisfactoriamente
   Unload Me 'cierro
   nombForm.Show 'abro
  End If
 Else
  cad = mensajes(6) 'se ingreso incorrectamente
 End If
'** REPORTES
Case Is = "rep_fisico"
 If nombForm.check_reuneCondi.Value = 1 Then aux = nombForm.check_reuneCondi.Caption
 If nombForm.Check_noReune.Value = 1 Then aux = nombForm.Check_noReune.Caption
 If nombForm.check_cliente.Value = 1 Then aux = nombForm.check_cliente.Caption
 cad = devolverCod("cod_protocolo as cod", "protocolo", "nro_reg='" & nombForm.cmb_reg.Text & "'", 0)
aux3 = updateReporte(1, cad, rep_fisico.txt_resultado.Text, rep_fisico.txt_conclusion.Text, rep_fisico.txt_recomendacion.Text, aux)
If aux3 = 1 Then
 cad = mensajes(5) 'se ingreso satisfactoriamente
 aux3 = devolverCod("cod_protocolo as cod", "protocolo", "nro_reg='" & nombForm.cmb_reg.Text & "'", 0)
 Unload Me 'cierro
 nombForm.Show 'abro
 Call ImpReporte(CInt(aux3), 1, 0) 'tbasico,fisico
Else
cad = mensajes(6) 'se ingreso incorrectamente
End If
Case Is = "rep_micro"
 If nombForm.check_reuneCondi.Value = 1 Then aux = nombForm.check_reuneCondi.Caption
 If nombForm.Check_noReune.Value = 1 Then aux = nombForm.Check_noReune.Caption
 If nombForm.check_cliente.Value = 1 Then aux = nombForm.check_cliente.Caption
 aux3 = updateReporte(2, devolverCod("cod_protocolo as cod", "protocolo", "nro_reg='" & nombForm.cmb_reg.Text & "'", 0), nombForm.txt_resultado.Text, nombForm.txt_conclusion.Text, nombForm.txt_recomenda.Text, aux)
If aux3 = 1 Then
 cad = mensajes(5) 'se ingreso satisfactoriamente
 Unload Me 'cierro
 nombForm.Show 'abro
Else
cad = mensajes(6) 'se ingreso incorrectamente
End If
'lbl_sar
'lbl_clase
End Select

End Sub

